﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) Michael Herndon.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------



namespace Amplify.Twitter
{
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Runtime.Serialization;
	using System.ServiceModel;
	using System.ServiceModel.Web;
	using System.Text;

	/// <summary>
	/// Contract for twitter status methods. 
	/// </summary>
	[ServiceContract]
	public interface IStatusClient
	{

		/// <summary>
		/// Gets the user timeline.
		/// </summary>
		/// <param name="id">The screen name or id of the user.</param>
		/// <param name="count">The count of records to return. Can not exceed 200. </param>
		/// <param name="page">The page number to return for paging purposes. </param>
		/// <param name="sinceId">The integer id that says to bring back that message and everything after that message. </param>
		/// <param name="since">The date/time minimum of how far to go back. </param>
		/// <returns>returns an array of <see cref="Amplify.Twitter.Status"/>. </returns>
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract]
		[WebInvoke(
			BodyStyle = WebMessageBodyStyle.Bare,
			ResponseFormat = WebMessageFormat.Json,
			UriTemplate = "/statuses/user_timeline/{id}.json?count={count}&page={page}&since={since}&since_id={sinceId}")]
		Status[] GetUserTimeline(string id, int count, int page, int sinceId, string since);

		/// <summary>
		/// Gets the friend timeline of tweets (statuses).
		/// </summary>
		/// <param name="count">The count of records to return. Can not exceed 200. </param>
		/// <param name="page">The page number to return for paging purposes. </param>
		/// <param name="sinceId">The integer id that says to bring back that message and everything after that message. </param>
		/// <param name="since">The date/time minimum of how far to go back. </param>
		/// <returns>returns an array of <see cref="Amplify.Twitter.Status"/> </returns>
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract]
		[WebInvoke(
			BodyStyle = WebMessageBodyStyle.Bare,
			ResponseFormat = WebMessageFormat.Json,
			UriTemplate = "/statuses/friends_timeline.json?count={count}&page={page}&since={since}&since_id={sinceId}")]
		Status[] GetFriendsTimeline(int count, int page, int sinceId, string since);



		/// <summary>
		/// Gets an array of <see cref="Amplify.Twitter.Status"/> that are replies.
		/// </summary>
		/// <param name="page">The page number (for paging). </param>
		/// <param name="since">Specify a search date for all the friends that have joined since.  </param>
		/// <param name="sinceId">Specify a integer for all ids to be greater than. </param>
		/// <returns>returns an array of <see cref="Amplify.Twitter.Status"/>.</returns>
		/// <exception cref="System.ServiceModel.Security.MessageSecurityException" />
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract]
		[WebInvoke(
			BodyStyle = WebMessageBodyStyle.Bare,
			ResponseFormat = WebMessageFormat.Json,
			UriTemplate = "/statuses/replies.json?page={page}&since={since}&since_id={sinceId}")]
		Status[] GetReplies(int page, int sinceId, string since);

		/// <summary>
		/// Gets the public timeline of tweets (statuses).
		/// </summary>
		/// <param name="count">The count of records to return. Can not exceed 200. </param>
		/// <param name="page">The page number to return for paging purposes. </param>
		/// <param name="sinceId">The integer id that says to bring back that message and everything after that message. </param>
		/// <param name="since">The date/time minimum of how far to go back. </param>
		/// <returns>returns an array of <see cref="Amplify.Twitter.Status"/>. </returns>
		[OperationContract]
		[WebInvoke(
			BodyStyle = WebMessageBodyStyle.Bare,
			ResponseFormat = WebMessageFormat.Json,
			UriTemplate = "/statuses/public_timeline.json?count={count}&page={page}&since={since}&since_id={sinceId}")]
		Status[] GetPublicTimeline(int count, int page, int sinceId, string since);



		/// <summary>
		/// Creates the specified text.
		/// </summary>
		/// <param name="text">The text.</param>
		/// <returns>returns a <see cref="Amplify.Twitter.Status"/> object.</returns>
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract]
		[WebInvoke(
			BodyStyle = WebMessageBodyStyle.Bare,
			ResponseFormat = WebMessageFormat.Json,
			UriTemplate = "/statuses/update.json?status={text}")]
		Status Create(string text);

		/// <summary>
		/// Shows the specified Status.
		/// </summary>
		/// <param name="statusId">The id.</param>
		/// <returns>returns a <see cref="Amplify.Twitter.Status"/> object.</returns>
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract]
		[WebInvoke(
			BodyStyle = WebMessageBodyStyle.Bare,
			ResponseFormat = WebMessageFormat.Json,
			UriTemplate = "/statuses/show/{statusId}.json")]
		Status Show(string statusId);


		/// <summary>
		/// Destroys the specified Status by id.
		/// </summary>
		/// <param name="statusId">The id.</param>
		/// <returns>returns a <see cref="Amplify.Twitter.Status"/> object.</returns>
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract]
		[WebInvoke(
			BodyStyle = WebMessageBodyStyle.Bare,
			ResponseFormat = WebMessageFormat.Json,
			UriTemplate = "/statuses/destroy/{statusId}.json")]
		Status Destroy(string statusId);

	}
}
